package org.telluriumsource.ui.widget.dojo.builder

import demo.tellurium.framework.BaseWidgetUiObjectBuilder 
import org.telluriumsource.ui.widget.dojo.object.AutoCompleteTextBox 


/**
 * Builder for widget AutoComplete TextBox
 *
 * @author Roger Xu (roger.xu.2007@gmail.com)
 *
 * Date: Apr 14, 2010
 * 
 */
class AutoCompleteTextBoxBuilder extends BaseWidgetUiObjectBuilder {

    private static final String WIDGET_ID = "widgetid";

    @Override
    public build(Map map, Closure c) {
        //add default parameters so that the builder can use them if not specified
        def df = [:];
        AutoCompleteTextBox widget = this.internBuild(new AutoCompleteTextBox(), map, df);

        if (map.get(WIDGET_ID) != null) {
            widget.widgetId = map.get(WIDGET_ID);
        }
        widget.defineWidget();

        return widget;
    }
}